﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcProject.Models.ContractInfo>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    合同信息编辑
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        合同信息编辑</h2>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>合同信息</legend>
        <div class="editor-label">
            合同名称
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ContractName) %>
            <%: Html.ValidationMessageFor(model => model.ContractName) %>
        </div>
        <div class="editor-label">
            合同开始时间
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ContractStartDate, String.Format("{0:g}", Model.ContractStartDate)) %>
            <%: Html.ValidationMessageFor(model => model.ContractStartDate) %>
        </div>
        <div class="editor-label">
            合同结束时间
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ContractEndDate, String.Format("{0:g}", Model.ContractEndDate)) %>
            <%: Html.ValidationMessageFor(model => model.ContractEndDate) %>
        </div>
        <div class="editor-label">
            合同金额
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ContractMoney) %>
            <%: Html.ValidationMessageFor(model => model.ContractMoney) %>
        </div>
        <div class="editor-label">
            合同备注
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ContractNote) %>
            <%: Html.ValidationMessageFor(model => model.ContractNote) %>
        </div>
        <div class="editor-label">
            合同附件
        </div>
        <div class="editor-field">
            <div>
                <%: Html.ActionLink("上传合同附件", "../Pages/Upload/UploadDefault.aspx", new { fk = Model.ContractId, type = MvcProject.Utils.AttachinfoEnum.Contract.ToString() }, new { target = "_blank" })%>
            </div>
            <div>
                <table>
                <tr>
                    <th>
                        附件
                    </th>
                    <th>
                    </th>
                </tr>
                <%
                    IEnumerable<MvcProject.Models.AttachInfo> AttachInfos = (IEnumerable<MvcProject.Models.AttachInfo>)ViewData["attachinfos"];
                    if (AttachInfos != null) foreach (var item in AttachInfos)
                        { %>
                <tr>
                    <td>
                        <%:  Html.ActionLink("浏览", "../AttachInfo/" + item.attachmentPath, new {  }, new { target = "_blank" })%>
                    </td>
                    <td>
                        <%: Html.ActionLink("删除", "../ContractInfo/DeleteAttachInfo", new { id = item.guid,type=1 }, new { target = "_blank" })%>
                    </td>
                </tr>
                <% } %>
            </table>
            </div>
        </div>
        <p>
            <input type="submit" value="保存修改" />
        </p>
    </fieldset>
    <% } %>
</asp:Content>
